package com.ad.pet.app.account.record;

import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.ad.pet.DaggerMainActivityCompent;
import com.ad.pet.R;
import com.ad.pet.app.account.share.ShareContracts;
import com.ad.pet.app.account.share.SharePresenter;
import com.ad.pet.app.main.adapter.HomeIndexMallAdapter;
import com.ad.pet.common.structure.mvp.BasePresenter;
import com.ad.pet.common.structure.ui.activity.AppToolbarActivity;
import com.ad.pet.models.remote.account.share.ShareEndItem;
import com.ad.pet.models.remote.home.HomeMall;

import java.util.List;

import javax.inject.Inject;

import butterknife.BindView;

/**
 * Created by liuyixiang on 2019/9/24.
 */

public class ReviewRecordListActivity extends AppToolbarActivity implements ShareContracts.View{
    @Inject
    SharePresenter mPresenter;

    @Override
    protected void init(Bundle savedInstanceState) {
        super.init(savedInstanceState);
        mToolbar.setTitle("浏览记录");
        mStatusLayoutManager.showContent();
    }

    @BindView(R.id.recycler_lsit)
    RecyclerView mRecyclerList;
    HomeIndexMallAdapter homeIndexMallAdapter = null;

    @Override
    protected int contentLayout() {
        return R.layout.activity_review_record_list;
    }

    @Override
    protected void clickRetry(View v) {

    }

    @Override
    protected void initViews() {
            mPresenter.onCreate(this);

            homeIndexMallAdapter = new HomeIndexMallAdapter(null);
            mRecyclerList.setLayoutManager(new GridLayoutManager(mActivity,2));
            mRecyclerList.setAdapter(homeIndexMallAdapter);

            mPresenter.viewListRecord();
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initEvents() {

    }

    @Override
    public void initInject() {
        DaggerMainActivityCompent.builder().applicationComponent(getApplicationComponent())

                .activityModule(getActivityModule()).build().inject(this);
    }

    @Override
    protected BasePresenter getPresenter() {
        return null;
    }

    @Override
    public void showLoading() {

    }

    @Override
    public void hideLoading() {

    }

    @Override
    public void error(String msg) {

    }

    @Override
    public void error(int code, String msg) {

    }

    @Override
    public void app_share_product_dataSuccess(ShareEndItem shareEndItem) {

    }

    @Override
    public void app_share_friend_dataSuccess(ShareEndItem account) {

    }

    @Override
    public void viewListRecordSuccess(List<HomeMall> list) {
        homeIndexMallAdapter.setNewData(list);
    }
}
